package cn.jw.starter.mysql;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;

import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;

import jakarta.annotation.PostConstruct;

/**
 * 这个类是：mysql的自动化配置类
 *
 * @author 王广帅
 * @since 2024/4/2 1:09
 * @version 1.0.0
 */
@AutoConfiguration
@Import(DruidConfig.class)
public class JwMysqlAutoConfiguration {
    private Logger logger = LoggerFactory.getLogger(JwMysqlAutoConfiguration.class);

    @PostConstruct
    public void init() {
        logger.info("初始化mysql框架成功");
    }

    @Bean
    public PaginationInnerInterceptor paginationInnerInterceptor() {
        return new PaginationInnerInterceptor();
    }

}
